package com.example01;

/**
 * Created by yangjun on 2018/3/22.
 */
public class NvWa {
    public static void main(String[] args) {
        AbstractHumanFactory yinYangLu = new HumanFactory();

        System.out.println("--造出第一批人种是白色人种--");
        Human whiteHuman = yinYangLu.createHuman(WhiteHuman.class);
        whiteHuman.getColor();
        whiteHuman.talk();

        System.out.println("--造出第二批人种是黑色人种--");
        Human blackHuman = yinYangLu.createHuman(BlackHuman.class);
        blackHuman.getColor();
        blackHuman.talk();

        System.out.println("--造出第三批人种是黄色人种--");
        Human yellowHuman = yinYangLu.createHuman(YellowHuman.class);
        yellowHuman.getColor();
        yellowHuman.talk();
    }
}
